

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Snapshot Scheduling Module &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="CephFS Snapshot Mirroring" href="../cephfs-mirroring/" />
    <link rel="prev" title="CephFS Top Utility" href="../cephfs-top/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 文件系统</a> &raquo;</li>
        
      <li>Snapshot Scheduling Module</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/cephfs/snap-schedule.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 文件系统</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../#cephfs">CephFS 入门</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../#id4">管理</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../createfs/"> 创建 CephFS 文件系统</a></li>
<li class="toctree-l3"><a class="reference internal" href="../administration/"> 管理命令</a></li>
<li class="toctree-l3"><a class="reference internal" href="../multifs/"> 创建多个文件系统</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-remove-mds/"> 配备、增加、删除 MDS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/">术语</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds">MDS 守护进程的引用</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#id3">故障切换的管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds-standby-replay">热备的配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../standby/#mds-join-fs">配置 MDS 与文件系统的亲和性</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cache-configuration/"> MDS 缓存配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mds-config-ref/"> MDS 配置选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../man/8/ceph-mds/"> ceph-mds 手册页</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nfs/"> 通过 NFS 导出</a></li>
<li class="toctree-l3"><a class="reference internal" href="../app-best-practices/"> 应用最佳实践</a></li>
<li class="toctree-l3"><a class="reference internal" href="../fs-volumes/"> FS 卷和子卷</a></li>
<li class="toctree-l3"><a class="reference internal" href="../quota/"> CephFS 配额管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../health-messages/"> 健康消息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upgrading/">升级 MDS 集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upgrading/#firefly-jewel">升级比 Firefly 老的文件系统，需过 Jewel 这个槛</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-top/"> CephFS Top 工具</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#"> 定时快照</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#how-to-enable">How to enable</a></li>
<li class="toctree-l4"><a class="reference internal" href="#usage">Usage</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-mirroring/"> CephFS 快照镜像</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../#id5">挂载 CephFS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id6">CephFS 内幕</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id7">故障排除和灾难恢复</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id9">更多细节</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="snapshot-scheduling-module">
<span id="snap-schedule"></span><h1>Snapshot Scheduling Module<a class="headerlink" href="#snapshot-scheduling-module" title="Permalink to this headline">¶</a></h1>
<p>This module implements scheduled snapshots for CephFS.
It provides a user interface to add, query and remove snapshots schedules and
retention policies, as well as a scheduler that takes the snapshots and prunes
existing snapshots accordingly.</p>
<div class="section" id="how-to-enable">
<h2>How to enable<a class="headerlink" href="#how-to-enable" title="Permalink to this headline">¶</a></h2>
<p>The <em>snap_schedule</em> module is enabled with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mgr</span> <span class="n">module</span> <span class="n">enable</span> <span class="n">snap_schedule</span>
</pre></div>
</div>
</div>
<div class="section" id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<p>This module uses <a class="reference internal" href="../../dev/cephfs-snapshots/"><span class="doc">CephFS 快照</span></a>, please consider this documentation
as well.</p>
<p>This module’s subcommands live under the <cite>ceph fs snap-schedule</cite> namespace.
Arguments can either be supplied as positional arguments or as keyword
arguments. Once a keyword argument was encountered, all following arguments are
assumed to be keyword arguments too.</p>
<p>Snapshot schedules are identified by path, their repeat interval and their start
time. The
repeat interval defines the time between two subsequent snapshots. It is
specified by a number and a period multiplier, one of <cite>h(our)</cite>, <cite>d(ay)</cite> and
<cite>w(eek)</cite>. E.g. a repeat interval of <cite>12h</cite> specifies one snapshot every 12
hours.
The start time is specified as a time string (more details about passing times
below). By default
the start time is last midnight. So when a snapshot schedule with repeat
interval <cite>1h</cite> is added at 13:50
with the default start time, the first snapshot will be taken at 14:00.</p>
<p>Retention specifications are identified by path and the retention spec itself. A
retention spec consists of either a number and a time period separated by a
space or concatenated pairs of <cite>&lt;number&gt;&lt;time period&gt;</cite>.
The semantics are that a spec will ensure <cite>&lt;number&gt;</cite> snapshots are kept that are
at least <cite>&lt;time period&gt;</cite> apart. For Example <cite>7d</cite> means the user wants to keep 7
snapshots that are at least one day (but potentially longer) apart from each other.
The following time periods are recognized: <cite>h(our), d(ay), w(eek), m(onth),
y(ear)</cite> and <cite>n</cite>. The latter is a special modifier where e.g. <cite>10n</cite> means keep
the last 10 snapshots regardless of timing,</p>
<p>All subcommands take optional <cite>fs</cite> and <cite>subvol</cite> arguments to specify paths in
multi-fs setups and <a class="reference internal" href="../fs-volumes/"><span class="doc">FS volumes and subvolumes</span></a> managed setups. If not
passed <cite>fs</cite> defaults to the first file system listed in the fs_map, <cite>subvolume</cite>
defaults to nothing.
When using <a class="reference internal" href="../fs-volumes/"><span class="doc">FS volumes and subvolumes</span></a> the argument <cite>fs</cite> is equivalent to a
<cite>volume</cite>.</p>
<p>When a timestamp is passed (the <cite>start</cite> argument in the <cite>add</cite>, <cite>remove</cite>,
<cite>activate</cite> and <cite>deactivate</cite> subcommands) the ISO format <cite>%Y-%m-%dT%H:%M:%S</cite> will
always be accepted. When either python3.7 or newer is used or
<a class="reference external" href="https://github.com/movermeyer/backports.datetime_fromisoformat">https://github.com/movermeyer/backports.datetime_fromisoformat</a> is installed, any
valid ISO timestamp that is parsed by python’s <cite>datetime.fromisoformat</cite> is valid.</p>
<p>When no subcommand is supplied a synopsis is printed:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#&gt; ceph fs snap-schedule</span>
<span class="n">no</span> <span class="n">valid</span> <span class="n">command</span> <span class="n">found</span><span class="p">;</span> <span class="mi">8</span> <span class="n">closest</span> <span class="n">matches</span><span class="p">:</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">status</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="nb">format</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="nb">list</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">recursive</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="nb">format</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">add</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">snap_schedule</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">start</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">remove</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">repeat</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">start</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">add</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">retention_spec_or_period</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">retention_count</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">remove</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">retention_spec_or_period</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">retention_count</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">activate</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">repeat</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">start</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">deactivate</span> <span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">repeat</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">start</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">subvol</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">fs</span><span class="o">&gt;</span><span class="p">]</span>
<span class="n">Error</span> <span class="n">EINVAL</span><span class="p">:</span> <span class="n">invalid</span> <span class="n">command</span>
</pre></div>
</div>
<div class="section" id="inspect-snapshot-schedules">
<h3>Inspect snapshot schedules<a class="headerlink" href="#inspect-snapshot-schedules" title="Permalink to this headline">¶</a></h3>
<p>The module offers two subcommands to inspect existing schedules: <cite>list</cite> and
<cite>status</cite>. Bother offer plain and json output via the optional <cite>format</cite> argument.
The default is plain.
The <cite>list</cite> sub-command will list all schedules on a path in a short single line
format. It offers a <cite>recursive</cite> argument to list all schedules in the specified
directory and all contained directories.
The <cite>status</cite> subcommand prints all available schedules and retention specs for a
path.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">status</span> <span class="o">/</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">status</span> <span class="o">/</span><span class="n">foo</span><span class="o">/</span><span class="n">bar</span> <span class="o">--</span><span class="nb">format</span><span class="o">=</span><span class="n">json</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="nb">list</span> <span class="o">/</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="nb">list</span> <span class="o">/</span> <span class="o">--</span><span class="n">recursive</span><span class="o">=</span><span class="n">true</span> <span class="c1"># list all schedules in the tree</span>
</pre></div>
</div>
</div>
<div class="section" id="add-and-remove-schedules">
<h3>Add and remove schedules<a class="headerlink" href="#add-and-remove-schedules" title="Permalink to this headline">¶</a></h3>
<p>The <cite>add</cite> and <cite>remove</cite> subcommands add and remove snapshots schedules
respectively. Both require at least a <cite>path</cite> argument, <cite>add</cite> additionally
requires a <cite>schedule</cite> argument as described in the USAGE section.</p>
<p>Multiple different schedules can be added to a path. Two schedules are considered
different from each other if they differ in their repeat interval and their
start time.</p>
<p>If multiple schedules have been set on a path, <cite>remove</cite> can remove individual
schedules on a path by specifying the exact repeat interval and start time, or
the subcommand can remove all schedules on a path when just a <cite>path</cite> is
specified.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">add</span> <span class="o">/</span> <span class="mi">1</span><span class="n">h</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">add</span> <span class="o">/</span> <span class="mi">1</span><span class="n">h</span> <span class="mi">11</span><span class="p">:</span><span class="mi">55</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">add</span> <span class="o">/</span> <span class="mi">2</span><span class="n">h</span> <span class="mi">11</span><span class="p">:</span><span class="mi">55</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">remove</span> <span class="o">/</span> <span class="mi">1</span><span class="n">h</span> <span class="mi">11</span><span class="p">:</span><span class="mi">55</span> <span class="c1"># removes one single schedule</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">remove</span> <span class="o">/</span> <span class="mi">1</span><span class="n">h</span> <span class="c1"># removes all schedules with --repeat=1h</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">remove</span> <span class="o">/</span> <span class="c1"># removes all schedules on path /</span>
</pre></div>
</div>
</div>
<div class="section" id="add-and-remove-retention-policies">
<h3>Add and remove retention policies<a class="headerlink" href="#add-and-remove-retention-policies" title="Permalink to this headline">¶</a></h3>
<p>The <cite>retention add</cite> and <cite>retention remove</cite> subcommands allow to manage
retention policies. One path has exactly one retention policy. A policy can
however contain multiple count-time period pairs in order to specify complex
retention policies.
Retention policies can be added and removed individually or in bulk via the
forms <cite>ceph fs snap-schedule retention add &lt;path&gt; &lt;time period&gt; &lt;count&gt;</cite> and
<cite>ceph fs snap-schedule retention add &lt;path&gt; &lt;countTime period&gt;[countTime period]</cite></p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">add</span> <span class="o">/</span> <span class="n">h</span> <span class="mi">24</span> <span class="c1"># keep 24 snapshots at least an hour apart</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">add</span> <span class="o">/</span> <span class="n">d</span> <span class="mi">7</span> <span class="c1"># and 7 snapshots at least a day apart</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">remove</span> <span class="o">/</span> <span class="n">h</span> <span class="mi">24</span> <span class="c1"># remove retention for 24 hourlies</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">add</span> <span class="o">/</span> <span class="mi">24</span><span class="n">h4w</span> <span class="c1"># add 24 hourly and 4 weekly to retention</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">retention</span> <span class="n">remove</span> <span class="o">/</span> <span class="mi">7</span><span class="n">d4w</span> <span class="c1"># remove 7 daily and 4 weekly, leaves 24 hourly</span>
</pre></div>
</div>
</div>
<div class="section" id="active-and-inactive-schedules">
<h3>Active and inactive schedules<a class="headerlink" href="#active-and-inactive-schedules" title="Permalink to this headline">¶</a></h3>
<p>Snapshot schedules can be added for a path that doesn’t exist yet in the
directory tree. Similarly a path can be removed without affecting any snapshot
schedules on that path.
If a directory is not present when a snapshot is scheduled to be taken, the
schedule will be set to inactive and will be excluded from scheduling until
it is activated again.
A schedule can manually be set to inactive to pause the creating of scheduled
snapshots.
The module provides the <cite>activate</cite> and <cite>deactivate</cite> subcommands for this
purpose.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">activate</span> <span class="o">/</span> <span class="c1"># activate all schedules on the root directory</span>
<span class="n">ceph</span> <span class="n">fs</span> <span class="n">snap</span><span class="o">-</span><span class="n">schedule</span> <span class="n">deactivate</span> <span class="o">/</span> <span class="mi">1</span><span class="n">d</span> <span class="c1"># deactivates daily snapshots on the root directory</span>
</pre></div>
</div>
</div>
<div class="section" id="limitations">
<h3>Limitations<a class="headerlink" href="#limitations" title="Permalink to this headline">¶</a></h3>
<p>Snapshots are scheduled using python Timers. Under normal circumstances
specifying 1h as the schedule will result in snapshots 1 hour apart fairly
precisely. If the mgr daemon is under heavy load however, the Timer threads
might not get scheduled right away, resulting in a slightly delayed snapshot. If
this happens, the next snapshot will be schedule as if the previous one was not
delayed, i.e. one or more delayed snapshots will not cause drift in the overall
schedule.</p>
<p>In order to somewhat limit the overall number of snapshots in a file system, the
module will only keep a maximum of 50 snapshots per directory. If the retention
policy results in more then 50 retained snapshots, the retention list will be
shortened to the newest 50 snapshots.</p>
</div>
<div class="section" id="data-storage">
<h3>Data storage<a class="headerlink" href="#data-storage" title="Permalink to this headline">¶</a></h3>
<p>The snapshot schedule data is stored in a rados object in the cephfs metadata
pool. At runtime all data lives in a sqlite database that is serialized and
stored as a rados object.</p>
</div>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../cephfs-mirroring/" class="btn btn-neutral float-right" title="CephFS Snapshot Mirroring" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../cephfs-top/" class="btn btn-neutral float-left" title="CephFS Top Utility" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>